<template>
  <ant-modal modalWidth="1000" modalHeight="600" :visible="open" :modal-title="formTitle" :adjust-size="true" :maskClosable="false"
    @cancel="cancel">
    <a-form-model ref="form" :model="form" :rules="rules" slot="content" layout="vertical">
      <a-row :gutter="32">
        <a-col :span="12">
          <a-form-model-item label="付款单号">
            <a-input v-model="form.payCode" readOnly v-if="form.id"/>
            <a-input v-model="form.payCode" placeholder="单号自动生成" :disabled='true' v-else/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="供应商" prop="supplierCode">
            <a-select placeholder="请选择供应商" v-model="form.supplierCode" style="width: 100%" 
              allow-clear show-search optionFilterProp="children">
              <a-select-option v-for="(d, index) in supplierOptions" :key="index" :value="d.supplierCode">{{
                d.supplierName }}</a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="应付金额">
            <a-input v-model="form.hasAmount"  readOnly/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="付款金额" prop="payAmount">
            <a-input v-model="form.payAmount"  placeholder="请输入付款金额"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="付款日期" prop="payDate">
            <a-date-picker v-model="form.payDate" valueFormat="YYYY-MM-DD" :show-today="true" placeholder="选择日期"
              style="width: 100%" />
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="付款账户" prop="payAccount">
            <a-select placeholder="请选择状态" v-model="form.payAccount" style="width: 100%" allow-clear>
              <a-select-option v-for="(d, index) in payOptions" :key="index" :value="d.dictLabel">{{ d.dictLabel }}</a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="备注" prop="remark">
            <a-input v-model="form.remark" placeholder="请输入备注" />
          </a-form-model-item>
        </a-col>
      </a-row>

    </a-form-model>
    <template slot="footer">
      <a-button :disabled="disabled" @click="cancel">
        取消
      </a-button>
      <a-button type="primary" :disabled="disabled" @click="submitForm(true)">
        保存
      </a-button>
    </template>
  </ant-modal>
</template>
<script>
import BizPayableForm from './BizPayableForm'
export default {
  ...BizPayableForm
}
</script>
<style lang="less" scoped>
.table-operations,
body tr.ant-table-expanded-row:hover .table-operations {
  padding-bottom: 8px;
  text-align: right;
}

.table-operations {
  margin-bottom: 16px;
}

.table-operations>button,
.table-operations .ant-input-affix-wrapper {
  margin-right: 8px;
}

.table_title {
  float: left;
  padding-left: 8px;
  font-weight: 600;
  color: #222222;
  line-height: 30px;
}
</style>
